import React from 'react'
import './复制粘贴栗子.css'
let el1 = <h1>我不是VIP</h1>
let el2 = <h1>我是VIP</h1>
class Toggle extends React.Component{
    state = {
        isShoe:true
    }
    handleToggle=()=>{
       this.setState({
           isShoe:!this.state.isShoe
       })
    }
    render(){
        let {isShoe} = this.state //结构isShoe
        return(
            <fieldset>
                <legend>toggle </legend>
                <div className='abc'>
                   {isShoe?el1:el2}
                </div>
                <button onClick={this.handleToggle}>
                    {isShoe?'充值VIP':'退钱'}
                </button>
            </fieldset>
        )
    }
}
export default Toggle 